package com.imooc.o2o.service;

import com.imooc.o2o.dto.ImageHolder;
import com.imooc.o2o.dto.ProductExecution;
import com.imooc.o2o.entity.Product;
import com.imooc.o2o.exceptions.ProductOperationException;

import java.util.List;

public interface ProductService {

    /**
     * 查商品列表并分页
     *
     * @param product
     * @param pageIndex
     * @param pageSize
     * @return
     */
    ProductExecution getProductList(Product product, int pageIndex, int pageSize);

    Product getProductById(long productId);

    ProductExecution addProduct(Product product, ImageHolder thumbnail
            , List<ImageHolder> productImgList) throws ProductOperationException;

    ProductExecution modifyProduct(Product product, ImageHolder thumbnail
            , List<ImageHolder> productImgHolderList) throws ProductOperationException;

}
